home *** CD-ROM | disk | FTP | other *** search
File List | 1991-09-24 | 346 b | 14 lines |
-
- #include <math.h>
- #define ABSOLUTE_EPSILON 1e-10
- #define RELATIVE_EPSILON 1e-6 /* 6 digits */
- float xnew, xold;
-
- xnew = 1.0; /* some initial estimate */
- do {
- xold = xnew;
- xnew = solution_refinement (xold);
- } while ( fabs(xnew - xold) > ABSOLUTE_EPSILON &&
- fabs (xnew-xold) > fabs(xnew) * RELATIVE_EPSILON );
-
-